package jgl.vajra.kingkong.part.home.viewModel;

import java.util.Map;

import jgl.vajra.kingkong.bean.HomeVehicleTypeBean;
import jgl.vajra.kingkong.part.home.contract.HomeVehicleTypeContract;
import jgl.vajra.kingkong.part.home.model.HomeVehicleTypeModel;
import jgl.vajra.kingkong.widget.mvvm.factory.CreateModel;
import jgl.vajra.kingkong.widget.retrofithelper.rxsubscriber.ProgressObserver;

@CreateModel(HomeVehicleTypeModel.class)
public class HomeVehicleTypeViewModel extends HomeVehicleTypeContract.ViewModel {
    @Override
    public void getCarInfoData(Map<String, Object> map) {
        mModel.getCarInfoData(map).subscribe(new ProgressObserver<HomeVehicleTypeBean>(false, null) {
            @Override
            public void _onNext(HomeVehicleTypeBean data) {
               if( mView !=null)
                 mView.returnHomeCarInfoBean(data);
            }

            @Override
            public void _onError(String errorMessage, int errorCode) {
                super._onError(errorMessage, errorCode);
            }
        });
    }

}
